using MediatR;
using RBAC.ErrorCode;
using SmartHealthcare.Read.Api.DTo;

namespace SmartHealthcare.Read.Api.Application.Command.PatientList
{
    /// <summary>
    /// 获取患者信息命令
    /// </summary>
    public class GetPatientInfoCommand : IRequest<APIResult<List<PatientInfoDto>>>
    {
        /// <summary>
        /// 病人卡号（可空）
        /// </summary>
        public string? MedicalCard { get; set; }

        /// <summary>
        /// 病房号（可空）
        /// </summary>
        public long? HospitalRoomCode { get; set; }

        /// <summary>
        /// 验证参数
        /// </summary>
        /// <returns></returns>
        public bool IsValid()
        {
            // 支持只有一个参数也能查询
            return !string.IsNullOrWhiteSpace(MedicalCard) || HospitalRoomCode.HasValue;
        }

        /// <summary>
        /// 检查是否有任何查询参数
        /// </summary>
        /// <returns></returns>
        public bool HasAnyParameter()
        {
            return !string.IsNullOrWhiteSpace(MedicalCard) || HospitalRoomCode.HasValue;
        }
    }
} 